﻿using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//暂时作废 2019.1.8 用NursingSummarySelForm3代替
namespace NursingDocumentInfoSystem
{
    public partial class NursingSummarySelForm : Form
    {
        
        public string str_ReturnSummary = "";//返回选取的病情摘要

        public NursingSummarySelForm(string str )
        {
            str_ReturnSummary = str;
            InitializeComponent();
            
        }

        private void NursingSummarySelForm_Load(object sender, EventArgs e)
        {
            //设置病情摘要选择记录
            //checkList_SummaryInfo.Items.Clear();
            //foreach (DataRow dr in dt_SummaryInfo.Rows)
            //{
            //    checkList_SummaryInfo.Items.Add(dr["IIINES_SUMMARY_ID"], dr["IIINES_SUMMARY_NAME"].ToString());
            //}
        }

     

        private void check1_CheckedChanged(object sender, EventArgs e)
        {
            if (check1.Checked == true)
            {
                text1.Visible = true;
                labelControl0.Visible = true;
                comboBoxEdit1.Visible = true;
                comboBoxEdit1.SelectedIndex = 0;
            }
            else
            {
                text1.Visible = false;
                labelControl0.Visible = false;
                comboBoxEdit1.Visible = false;
            }
        }

        private void check2_CheckedChanged(object sender, EventArgs e)
        {
            if (check2.Checked == true)
            {
                text2.Visible = true;
                labelControl1.Visible = true;
                comboBoxEdit2.Visible = true;
                comboBoxEdit2.SelectedIndex = 0;
            }
            else
            {
                text2.Visible = false;
                labelControl1.Visible = false;
                comboBoxEdit2.Visible = false;
            }
        }

        private void check3_CheckedChanged(object sender, EventArgs e)
        {
            if (check3.Checked == true)
            {
                text3.Visible = true;
                labelControl2.Visible = true;
                comboBoxEdit3.Visible = true;
                comboBoxEdit3.SelectedIndex = 0;
            }
            else
            {
                text3.Visible = false;
                labelControl2.Visible = false;
                comboBoxEdit3.Visible = false;
            }
        }

        private void check4_CheckedChanged(object sender, EventArgs e)
        {
            if (check4.Checked == true)
            {
                        text4.Visible = true;
                labelControl3.Visible = true;
                comboBoxEdit4.Visible = true;
                comboBoxEdit4.SelectedIndex = 0;
            }
            else
            {
                        text4.Visible = false;
                labelControl3.Visible = false;
                comboBoxEdit4.Visible = false;
            }
        }

        private void check5_CheckedChanged(object sender, EventArgs e)
        {
            if (check5.Checked == true)
            {
                text5.Visible = true;
                labelControl4.Visible = true;
                comboBoxEdit5.Visible = true;
                comboBoxEdit5.SelectedIndex = 0;
            }
            else
            {
                text5.Visible = false;
                labelControl4.Visible = false;
                comboBoxEdit5.Visible = false;
            }
        }

        private void check6_CheckedChanged(object sender, EventArgs e)
        {
            if (check6.Checked == true)
            {
                text6.Visible = true;
                labelControl5.Visible = true;
                comboBoxEdit6.Visible = true;
                comboBoxEdit6.SelectedIndex = 0;
            }
            else
            {
                text6.Visible = false;
                labelControl5.Visible = false;
                comboBoxEdit6.Visible = false;
            }
        }

        private void check7_CheckedChanged(object sender, EventArgs e)
        {
            if (check7.Checked == true)
            {
                text7.Visible = true;
                labelControl6.Visible = true;
                comboBoxEdit7.Visible = true;
                comboBoxEdit7.SelectedIndex = 0;
            }
            else
            {
                text7.Visible = false;
                labelControl6.Visible = false;
                comboBoxEdit7.Visible = false;
            }
        }

        private void check8_CheckedChanged(object sender, EventArgs e)
        {
            if (check8.Checked == true)
            {
                text8.Visible = true;
                labelControl7.Visible = true;
                comboBoxEdit8.Visible = true;
                comboBoxEdit8.SelectedIndex = 0;
            }
            else
            {
                text8.Visible = false;
                labelControl7.Visible = false;
                comboBoxEdit8.Visible = false;
            }
        }

        private void check9_CheckedChanged(object sender, EventArgs e)
        {
            if (check9.Checked == true)
            {
                text9.Visible = true;
                labelControl8.Visible = true;
                comboBoxEdit9.Visible = true;
                comboBoxEdit9.SelectedIndex = 0;
            }
            else
            {
                text9.Visible = false;
                labelControl8.Visible = false;
                comboBoxEdit9.Visible = false;
            }
        }

        private void check10_CheckedChanged(object sender, EventArgs e)
        {
            if (check10.Checked == true)
            {
                text10.Visible = true;
                labelControl9.Visible = true;
                comboBoxEdit10.Visible = true;
                comboBoxEdit10.SelectedIndex = 0;
            }
            else
            {
                text10.Visible = false;
                labelControl9.Visible = false;
                comboBoxEdit10.Visible = false;
            }
        }

        private void check11_CheckedChanged(object sender, EventArgs e)
        {
            if (check11.Checked == true)
            {
                text11.Visible = true;
                labelControl10.Visible = true;
                comboBoxEdit11.Visible = true;
                comboBoxEdit11.SelectedIndex = 0;
            }
            else
            {
                text11.Visible = false;
                labelControl10.Visible = false;
                comboBoxEdit11.Visible = false;
            }
        }

        private void check12_CheckedChanged(object sender, EventArgs e)
        {
            if (check12.Checked == true)
            {
                text12.Visible = true;
                labelControl11.Visible = true;
                comboBoxEdit12.Visible = true;
                comboBoxEdit12.SelectedIndex = 0;
            }
            else
            {
                text12.Visible = false;
                labelControl11.Visible = false;
                comboBoxEdit12.Visible = false;
            }
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            str_ReturnSummary = "";
            string[] name = new string[12];
            string[] num = new string[12];
            string[] way = new string[12];
            if (check1.Checked == true)
            {
                name[0] = check1.Text;
                num[0] = text1.Text;
                if (num[0].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                else num[0] += labelControl0.Text;
                way[0] = comboBoxEdit1.Text;
            }
            if (check2.Checked == true)
            {
                name[1] = check2.Text;
                num[1] = text2.Text;
                if (num[1].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                else num[1] += labelControl1.Text;
                way[1] = comboBoxEdit2.Text;
            }
            if (check3.Checked == true)
            {
                name[2] = check3.Text;
                num[2] = text3.Text;
                if (num[2].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                else num[2] += labelControl2.Text;
                way[2] = comboBoxEdit3.Text;
            }
            if (check4.Checked == true)
            {
                name[3] = check4.Text;
                num[3] = text4.Text;
                if (num[3].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                else num[3] += labelControl3.Text;
                way[3] = comboBoxEdit4.Text;
            }
            if (check5.Checked == true)
            {
                name[4] = check5.Text;
                num[4] = text5.Text;
                if (num[4].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                else num[4] += labelControl4.Text;
                way[4] = comboBoxEdit5.Text;
            }
            if (check6.Checked == true)
            {
                name[5] = check6.Text;
                num[5] = text6.Text;
                if (num[5].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                else num[5] += labelControl5.Text;
                way[5] = comboBoxEdit6.Text;
            }
            if (check7.Checked == true)
            {
                name[6] = check7.Text;
                num[6] = text7.Text;
                if (num[6].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                else num[6] += labelControl6.Text;
                way[6] = comboBoxEdit7.Text;
            }
            if (check8.Checked == true)
            {
                name[7] = check8.Text;
                num[7] = text8.Text;
                if (num[7].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                else num[7] += labelControl7.Text;
                way[7] = comboBoxEdit8.Text;
            }
            if (check9.Checked == true)
            {
                name[8] = check9.Text;
                num[8] = text9.Text;
                if (num[8].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                else num[8] += labelControl8.Text;
                way[8] = comboBoxEdit9.Text;
            }
            if (check10.Checked == true)
            {
                name[9] = check10.Text;
                num[9] = text10.Text;
                if (num[9].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                else num[9] += labelControl9.Text;
                way[9] = comboBoxEdit10.Text;
            }
            if (check11.Checked == true)
            {
                name[10] = check11.Text;
                num[10] = text11.Text;
                if (num[10].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                else num[10] += labelControl10.Text;
                way[10] = comboBoxEdit11.Text;
            }
            if (check12.Checked == true)
            {
                name[11] = check12.Text;
                num[11] = text12.Text;
                if (num[11].Length == 0)
                {
                    XtraMessageBox.Show("内容未填写");
                    return;
                }
                num[11] += labelControl11.Text;
                way[11] = comboBoxEdit12.Text;
            }
            for (int i = 0; i < 11; i++)
            {
                if (name[i] != null)
                {
                    str_ReturnSummary += name[i] + ",";
                }
            }
            if (str_ReturnSummary.Length > 0)
            {
                str_ReturnSummary = str_ReturnSummary.Remove(str_ReturnSummary.Length - 1, 1);
                str_ReturnSummary += "#";
            }
            else
            {
                str_ReturnSummary = "";
                Close();
            }
            for (int i = 0; i < 11; i++)
            {
                if (num[i] != null)
                {
                    str_ReturnSummary += num[i] + ",";
                }
            }
            if (str_ReturnSummary.Length > 0)
            {
                str_ReturnSummary = str_ReturnSummary.Remove(str_ReturnSummary.Length - 1, 1);
                str_ReturnSummary += "#";
            }
            for (int i = 0; i < 11; i++)
            {
                if (way[i] != null)
                {
                    str_ReturnSummary += way[i] + ",";
                }
            }
            if (str_ReturnSummary.Length > 0)
            {
                str_ReturnSummary = str_ReturnSummary.Remove(str_ReturnSummary.Length - 1, 1);
                Close();
            }
            
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
